<?php
/**
 * Author Yulin
 * Email  dwzhanglong@126.com
 * Date   2017-9-19
 * Func   排列三五
 */
defined('IN_YuLin') || exit('NO PERMIT!');

//	返回中奖金额	data为订单信息，plays为玩法

function PrizeCount_8($data,$plays)
{
	global $db;
	
	if(!$data || !$data['result'] || !$plays)
	{
		return 0;
	}
	
	//	玩法
	$result = explode(',',$data['result']);
	
	//	前四、后四、前三、中三、后三、前二、后二
	$qiansi = [$result[0],$result[1],$result[2],$result[3]];
	$housi = [$result[1],$result[2],$result[3],$result[4]];
	$qiansan = [$result[0],$result[1],$result[2]];
	$housan = [$result[2],$result[3],$result[4]];
	$zhongsan = [$result[1],$result[2],$result[3]];
	$qianer = [$result[0],$result[1]];
	$houer = [$result[3],$result[4]];
	
	//	五星单式
	if($plays['playid'] == 22257)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$result);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	五星复式
	if($plays['playid'] == 22258)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 5; $i++)
		{
			in_array($result[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 5 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	五星组合	可以中1-5星奖
	if($plays['playid'] == 22259)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = [];	//	第几位数中奖
		for($i = 0; $i < 5; $i++)
		{
			in_array($result[$i],explode(',',$tmp[$i])) && $tmp2[] = $i;
		}
		
		//	1-5个星将奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	奖金
		$tmp0 = 0;
		
		//	一星
		in_array(4,$tmp2) && $tmp0 += $t2[0]['maxprize'];
		
		//	二星
		in_array(3,$tmp2) && in_array(4,$tmp2) && $tmp0 += $t2[1]['maxprize'];
		
		//	三星
		in_array(2,$tmp2) && in_array(3,$tmp2) && in_array(4,$tmp2) && $tmp0 += $t2[2]['maxprize'];
		
		//	四星
		in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && in_array(4,$tmp2) && $tmp0 += $t2[3]['maxprize'];
		
		//	五星
		in_array(0,$tmp2) && in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && in_array(4,$tmp2) && $tmp0 += $t2[4]['maxprize'];
		
		return $tmp0 ? $tmp0 * $data['times'] : 0;
	}
	
	//	五星组选120
	if($plays['playid'] == 22264)
	{
		//	由于组合选的时候，不会出现重复数字，所以开奖号不能出现重复
		$tmp = array_unique($result);
		if(count($tmp) < 5)
		{
			return 0;
		}
		
		$tmp = explode('|',$data['rednum']);
		return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	五星组选60	二重号出现1次，后三个数都得出现
	if($plays['playid'] == 22265)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	二重号必须出现2次
		$tmp3 = 0;	//	二重号出现2次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后三个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 3)
		{
			return 0;
		}
		
		return $tmp3 * NumGroup($tmp5,3) * $plays['maxprize'] * $data['times'];
	}
	
	//	五星组选30	二重号出现2次，后一个数得出现
	if($plays['playid'] == 22266)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	两个二重号都必须出现2次
		$tmp3 = 0;	//	二重号出现2次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}		
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	五星组选20	三重号出现1次，后2个数得出现
	if($plays['playid'] == 22267)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	三重号都必须出现3次
		$tmp3 = 0;	//	三重号出现3次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 3 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后三个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 2)
		{
			return 0;
		}
		
		return $tmp3 * NumGroup($tmp5,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	五星组选10	三重号出现1次，二重号出现1次
	if($plays['playid'] == 22268)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	三重号都必须出现1次
		$tmp3 = 0;	//	三重号出现3次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 3 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后三个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return $tmp3 * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	五星组选5	四重号出现1次，后1个数得出现
	if($plays['playid'] == 22269)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($result);
		
		//	四重号都必须出现1次
		$tmp3 = 0;	//	四重号出现4次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 4 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return $tmp3 * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	前四单式
	if($plays['playid'] == 23505)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$qiansi);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前四复式
	if($plays['playid'] == 23506)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 4; $i++)
		{
			in_array($result[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 4 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前四组合	可以中1-4星奖
	if($plays['playid'] == 23507)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = [];	//	第几位数中奖
		for($i = 0; $i < 4; $i++)
		{
			in_array($result[$i],explode(',',$tmp[$i])) && $tmp2[] = $i;
		}
		
		//	1-5个星将奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	奖金
		$tmp0 = 0;
		
		//	一星
		in_array(3,$tmp2) && $tmp0 += $t2[0]['maxprize'];
		
		//	二星
		in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[1]['maxprize'];
		
		//	三星
		in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[2]['maxprize'];
		
		//	四星
		in_array(0,$tmp2) && in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[3]['maxprize'];
		
		return $tmp0 ? $tmp0 * $data['times'] : 0;
	}
	
	//	前四组选24
	if($plays['playid'] == 23511)
	{
		//	由于组合选的时候，不会出现重复数字，所以开奖号不能出现重复
		$tmp = array_unique($qiansi);
		if(count($tmp) < 3)
		{
			return 0;
		}
		
		$tmp = explode('|',$data['rednum']);
		return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前四组选12	一个二重号，后面2个数得出现
	if($plays['playid'] == 23512)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($qiansi);
		
		//	2重号都必须出现1次
		$tmp3 = 0;	//	2重号出现2次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 2)
		{
			return 0;
		}
		
		return $tmp3 * NumGroup($tmp5,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	前四组选6	2个二重号
	if($plays['playid'] == 23513)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($qiansi);
		
		//	2重号都必须出现1次
		$tmp3 = 0;	//	2重号出现2次的个数
		foreach($tmp as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	前四组选4	一个三重号，后面1个数得出现
	if($plays['playid'] == 23514)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($qiansi);
		
		//	3重号都必须出现1次
		$tmp3 = 0;	//	3重号出现3次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 3 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return $tmp3 * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	后四单式
	if($plays['playid'] == 2139)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$housi);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后四复式
	if($plays['playid'] == 2140)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 4; $i++)
		{
			in_array($housi[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 4 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后四组合	可以中1-4星奖
	if($plays['playid'] == 22272)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = [];	//	第几位数中奖
		for($i = 0; $i < 4; $i++)
		{
			in_array($housi[$i],explode(',',$tmp[$i])) && $tmp2[] = $i;
		}
		
		//	1-4个星将奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	奖金
		$tmp0 = 0;
		
		//	一星
		in_array(3,$tmp2) && $tmp0 += $t2[0]['maxprize'];
		
		//	二星
		in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[1]['maxprize'];
		
		//	三星
		in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[2]['maxprize'];
		
		//	四星
		in_array(0,$tmp2) && in_array(1,$tmp2) && in_array(2,$tmp2) && in_array(3,$tmp2) && $tmp0 += $t2[3]['maxprize'];
		
		return $tmp0 ? $tmp0 * $data['times'] : 0;
	}
	
	//	后四组选24
	if($plays['playid'] == 22276)
	{
		//	由于组合选的时候，不会出现重复数字，所以开奖号不能出现重复
		$tmp = array_unique($housi);
		if(count($tmp) < 3)
		{
			return 0;
		}
		
		$tmp = explode('|',$data['rednum']);
		return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后四组选12	一个二重号，后面2个数得出现
	if($plays['playid'] == 22277)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($housi);
		
		//	2重号都必须出现1次
		$tmp3 = 0;	//	2重号出现2次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 2)
		{
			return 0;
		}
		
		return $tmp3 * NumGroup($tmp5,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	后四组选6	2个二重号
	if($plays['playid'] == 22278)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($housi);
		
		//	2重号都必须出现1次
		$tmp3 = 0;	//	2重号出现2次的个数
		foreach($tmp as $t4)
		{
			$tmp2[$t4] == 2 && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	后四组选4	一个三重号，后面1个数得出现
	if($plays['playid'] == 22279)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp2 = array_count_values($housi);
		
		//	3重号都必须出现1次
		$tmp3 = 0;	//	3重号出现3次的个数
		$tmp4 = explode(',',$tmp[0]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 3 && $tmp3++;
		}
		
		if($tmp3 < 1)
		{
			return 0;
		}
		
		$tmp5 = 0;	//	后1个号出现的个数
		$tmp4 = explode(',',$tmp[1]);
		foreach($tmp4 as $t4)
		{
			$tmp2[$t4] == 1 && $tmp5++;
		}
		
		if($tmp5 < 1)
		{
			return 0;
		}
		
		return $tmp3 * $tmp5 * $plays['maxprize'] * $data['times'];
	}
	
	//	后三直选单式
	if($plays['playid'] == 22280)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$housan);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后三直选复式
	if($plays['playid'] == 22281)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 3; $i++)
		{
			in_array($housan[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 3 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后三直选和值
	if($plays['playid'] == 22282)
	{
		$tmp = $housan[0] + $housan[1] + $housan[2];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后三组三
	if($plays['playid'] == 22283)
	{
		$tmp2 = array_unique($housan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	后三组六
	if($plays['playid'] == 22284)
	{
		$tmp2 = array_unique($housan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 3)
		{
			return 0;
		}
		
		return NumGroup($tmp3,3) * $plays['maxprize'] * $data['times'];
	}
	
	//	后三混合组选
	if($plays['playid'] == 22285)
	{
		$tmp2 = array_unique($housan);	//	组合中不会出现重复
		
		$tmp8 = 0;	//	所中奖金
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t1)
		{
			$tmp3 = 0;
			
			$tmp4 = explode(',',$t1);
			foreach($tmp4 as $t4)
			{
				in_array($t4,$tmp2) && $tmp3++;
			}
			
			if($tmp3 > 2)	//	组六
			{
				$tmp8 += NumGroup($tmp3,3) * $t2[1]['maxprize'];
			}
			else if($tmp3 > 1)	//	组三
			{
				$tmp8 += $t2[0]['maxprize'];
			}
		}

		return $tmp8 ? $tmp8 * $data['times'] : 0;
	}
	
	//	后三组选和值
	if($plays['playid'] == 22287)
	{
		$tmp = $housan[0] + $housan[1] + $housan[2];
		$tmp2 = explode('|',$data['rednum']);
		
		if(!in_array($tmp,$tmp2))
		{
			return 0;
		}
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	有重复值则中组三，否则中组六
		return ((($housan[0] == $housan[1]) || ($housan[0] == $housan[2]) || ($housan[1] == $housan[2])) ? $t2[0]['maxprize'] : $t2[1]['maxprize']) * $data['times'];
	}
	
	//	前三直选单式
	if($plays['playid'] == 22289)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$qiansan);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前三直选复式
	if($plays['playid'] == 22290)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 3; $i++)
		{
			in_array($qiansan[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 3 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前三直选和值
	if($plays['playid'] == 22291)
	{
		$tmp = $qiansan[0] + $qiansan[1] + $qiansan[2];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前三组三
	if($plays['playid'] == 22292)
	{
		$tmp2 = array_unique($qiansan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	前三组六
	if($plays['playid'] == 22293)
	{
		$tmp2 = array_unique($qiansan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 3)
		{
			return 0;
		}
		
		return NumGroup($tmp3,3) * $plays['maxprize'] * $data['times'];
	}
	
	//	前三混合组选
	if($plays['playid'] == 22294)
	{
		$tmp2 = array_unique($qiansan);	//	组合中不会出现重复
		
		$tmp8 = 0;	//	所中奖金
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t1)
		{
			$tmp3 = 0;
			
			$tmp4 = explode(',',$t1);
			foreach($tmp4 as $t4)
			{
				in_array($t4,$tmp2) && $tmp3++;
			}
			
			if($tmp3 > 2)	//	组六
			{
				$tmp8 += NumGroup($tmp3,3) * $t2[1]['maxprize'];
			}
			else if($tmp3 > 1)	//	组三
			{
				$tmp8 += $t2[0]['maxprize'];
			}
		}

		return $tmp8 ? $tmp8 * $data['times'] : 0;
	}
	
	//	前三组选和值
	if($plays['playid'] == 22296)
	{
		$tmp = $qiansan[0] + $qiansan[1] + $qiansan[2];
		$tmp2 = explode('|',$data['rednum']);
		
		if(!in_array($tmp,$tmp2))
		{
			return 0;
		}
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	有重复值则中组三，否则中组六
		return ((($qiansan[0] == $qiansan[1]) || ($qiansan[0] == $qiansan[2]) || ($qiansan[1] == $qiansan[2])) ? $t2[0]['maxprize'] : $t2[1]['maxprize']) * $data['times'];
	}
	
	//	中三直选单式
	if($plays['playid'] == 22298)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$zhongsan);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	中三直选复式
	if($plays['playid'] == 22299)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 3; $i++)
		{
			in_array($zhongsan[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 3 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	中三直选和值
	if($plays['playid'] == 22300)
	{
		$tmp = $zhongsan[0] + $zhongsan[1] + $zhongsan[2];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	中三组三
	if($plays['playid'] == 22301)
	{
		$tmp2 = array_unique($zhongsan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 2)
		{
			return 0;
		}
		
		return NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'];
	}
	
	//	中三组六
	if($plays['playid'] == 22302)
	{
		$tmp2 = array_unique($zhongsan);	//	组合中不会出现重复
		
		$tmp3 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$tmp2) && $tmp3++;
		}
		
		if($tmp3 < 3)
		{
			return 0;
		}
		
		return NumGroup($tmp3,3) * $plays['maxprize'] * $data['times'];
	}
	
	//	中三混合组选
	if($plays['playid'] == 22303)
	{
		$tmp2 = array_unique($zhongsan);	//	组合中不会出现重复
		
		$tmp8 = 0;	//	所中奖金
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t1)
		{
			$tmp3 = 0;
			
			$tmp4 = explode(',',$t1);
			foreach($tmp4 as $t4)
			{
				in_array($t4,$tmp2) && $tmp3++;
			}
			
			if($tmp3 > 2)	//	组六
			{
				$tmp8 += NumGroup($tmp3,3) * $t2[1]['maxprize'];
			}
			else if($tmp3 > 1)	//	组三
			{
				$tmp8 += $t2[0]['maxprize'];
			}
		}

		return $tmp8 ? $tmp8 * $data['times'] : 0;
	}
	
	//	中三组选和值
	if($plays['playid'] == 22305)
	{
		$tmp = $zhongsan[0] + $zhongsan[1] + $zhongsan[2];
		$tmp2 = explode('|',$data['rednum']);
		
		if(!in_array($tmp,$tmp2))
		{
			return 0;
		}
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	有重复值则中组三，否则中组六
		return ((($zhongsan[0] == $zhongsan[1]) || ($zhongsan[0] == $zhongsan[2]) || ($zhongsan[1] == $zhongsan[2])) ? $t2[0]['maxprize'] : $t2[1]['maxprize']) * $data['times'];
	}
	
	//	后二直选复式
	if($plays['playid'] == 22307)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 2; $i++)
		{
			in_array($houer[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 2 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二直选单式
	if($plays['playid'] == 22308)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$houer);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二直选复式
	if($plays['playid'] == 22309)
	{
		$tmp0 = 0;
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 2; $i++)
		{
			in_array($qianer[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 2 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二直选单式
	if($plays['playid'] == 22310)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp3 = implode(',',$qianer);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 == $tmp3 && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二直选和值
	if($plays['playid'] == 22311)
	{
		$tmp = $houer[0] + $houer[1];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二直选和值
	if($plays['playid'] == 22312)
	{
		$tmp = $qianer[0] + $qianer[1];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二组选复式
	if($plays['playid'] == 22313)
	{
		$tmp = explode('|',$data['rednum']);
		
		return in_array($houer[0],$tmp) && in_array($houer[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二组选单式
	if($plays['playid'] == 22314)
	{
		$tmp = explode('|',$data['rednum']);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 = explode(',',$t2);
			
			in_array($houer[0],$t2) && in_array($houer[1],$t2) && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二组选复式
	if($plays['playid'] == 22315)
	{
		$tmp = explode('|',$data['rednum']);
		
		return in_array($qianer[0],$tmp) && in_array($qianer[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二组选单式
	if($plays['playid'] == 22316)
	{
		$tmp = explode('|',$data['rednum']);
		
		$tmp2 = 0;
		foreach($tmp as $t2)
		{
			$t2 = explode(',',$t2);
			
			in_array($qianer[0],$t2) && in_array($qianer[1],$t2) && $tmp2++;
		}
		
		return $tmp2 ? $tmp2 * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二组选和值
	if($plays['playid'] == 22317)
	{
		//	对子不中奖
		if($houer[0] == $houer[1])
		{
			return 0;
		}
		
		$tmp = $houer[0] + $houer[1];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前二组选和值
	if($plays['playid'] == 22318)
	{
		//	对子不中奖
		if($qianer[0] == $qianer[1])
		{
			return 0;
		}
		
		$tmp = $qianer[0] + $qianer[1];
		
		return in_array($tmp,explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	定位胆
	if($plays['parentid'] == 2179)
	{
		//	万位、千位、百位、十位、个位
		if($plays['parentid'] == 22319)
		{
			return in_array($result[0],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['parentid'] == 22320)
		{
			return in_array($result[1],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['parentid'] == 22321)
		{
			return in_array($result[2],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['parentid'] == 22322)
		{
			return in_array($result[3],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['parentid'] == 32323)
		{
			return in_array($result[4],explode('|',$data['rednum'])) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	后三一码不定胆
	if($plays['playid'] == 22324)
	{
		$tmp2 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$housan) && $tmp2++;
		}
		
		return $tmp2 * $plays['maxprize'] * $data['times'];
	}
	
	//	后三二码不定胆
	if($plays['playid'] == 22325)
	{
		$tmp = array_unique($housan);
		$tmp2 = explode('|',$data['rednum']);
		
		$len = count($tmp);
		if($len == 1)	//	豹子不中
		{
			return 0;
		}
		else if($len == 2)	//	对子
		{
			return in_array($tmp[0],$tmp2) && in_array($tmp[1],$tmp2) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		$tmp3 = 0;
		in_array($tmp[0],$tmp2) && $tmp3++;
		in_array($tmp[1],$tmp2) && $tmp3++;
		in_array($tmp[2],$tmp2) && $tmp3++;
		
		return $tmp3 > 1 ? NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	前三一码不定胆
	if($plays['playid'] == 22326)
	{
		$tmp2 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$qiansan) && $tmp2++;
		}
		
		return $tmp2 * $plays['maxprize'] * $data['times'];
	}
	
	//	前三二码不定胆
	if($plays['playid'] == 22327)
	{
		$tmp = array_unique($qiansan);
		$tmp2 = explode('|',$data['rednum']);
		
		$len = count($tmp);
		if($len == 1)	//	豹子不中
		{
			return 0;
		}
		else if($len == 2)	//	对子
		{
			return in_array($tmp[0],$tmp2) && in_array($tmp[1],$tmp2) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		$tmp3 = 0;
		in_array($tmp[0],$tmp2) && $tmp3++;
		in_array($tmp[1],$tmp2) && $tmp3++;
		in_array($tmp[2],$tmp2) && $tmp3++;
		
		return $tmp3 > 1 ? NumGroup($tmp3,2) * $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	后二大小单双
	if($plays['playid'] == 22328)
	{
		$da = [$houer[0] > 4,$houer[1] > 4];
		$dan = [$houer[0] % 2,$houer[1] % 2];
		
		$tmp3 = [0,0];
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $k2 => $t2)
		{
			$t2 = explode(',',$t2);
			if($da[$k2])
			{
				in_array('大',$t2) && $tmp3[$k2]++;
			}
			else
			{
				in_array('小',$t2) && $tmp3[$k2]++;
			}
			
			if($dan[$k2])
			{
				in_array('单',$t2) && $tmp3[$k2]++;
			}
			else
			{
				in_array('双',$t2) && $tmp3[$k2]++;
			}
		}
		
		return $tmp3[0] * $tmp3[1] * $plays['maxprize'] * $data['times'];
	}
	
	//	前二大小单双
	if($plays['playid'] == 22329)
	{
		$da = [$qianer[0] > 4,$qianer[1] > 4];
		$dan = [$qianer[0] % 2,$qianer[1] % 2];
		
		$tmp3 = [0,0];
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $k2 => $t2)
		{
			$t2 = explode(',',$t2);
			if($da[$k2])
			{
				in_array('大',$t2) && $tmp3[$k2]++;
			}
			else
			{
				in_array('小',$t2) && $tmp3[$k2]++;
			}
			
			if($dan[$k2])
			{
				in_array('单',$t2) && $tmp3[$k2]++;
			}
			else
			{
				in_array('双',$t2) && $tmp3[$k2]++;
			}
		}
		
		return $tmp3[0] * $tmp3[1] * $plays['maxprize'] * $data['times'];
	}
	
	//	一帆风顺
	if($plays['playid'] == 22330)
	{
		$tmp3 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			in_array($t2,$result) && $tmp3++;
		}
		
		return $tmp3 * $plays['maxprize'] * $data['times'];
	}
	
	//	好事成双
	if($plays['playid'] == 22331)
	{
		$tmp3 = array_count_values($result);
		
		$tmp3 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			$tmp3[$t2] > 1 && $tmp3++;
		}
		
		return $tmp3 * $plays['maxprize'] * $data['times'];
	}
	
	//	三星报喜
	if($plays['playid'] == 22332)
	{
		$tmp3 = array_count_values($result);
		
		$tmp3 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			$tmp3[$t2] > 2 && $tmp3++;
		}
		
		return $tmp3 * $plays['maxprize'] * $data['times'];
	}
	
	//	四季发财
	if($plays['playid'] == 22333)
	{
		$tmp3 = array_count_values($result);
		
		$tmp3 = 0;
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t2)
		{
			$tmp3[$t2] > 3 && $tmp3++;
		}
		
		return $tmp3 * $plays['maxprize'] * $data['times'];
	}
	
	//	任选二复式
	if($plays['parentid'] == 2190)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp[0] = explode(',',$tmp[0]);
		$tmp[1] = explode(',',$tmp[1]);
		
		if($plays['playid'] == 22334)	//	万十
		{
			return in_array($result[0],$tmp[0]) && in_array($result[3],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22335)	//	万千
		{
			return in_array($result[0],$tmp[0]) && in_array($result[1],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22336)	//	万个
		{
			return in_array($result[0],$tmp[0]) && in_array($result[4],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22337)	//	万百
		{
			return in_array($result[0],$tmp[0]) && in_array($result[2],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22338)	//	十个
		{
			return in_array($result[3],$tmp[0]) && in_array($result[4],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22339)	//	千十
		{
			return in_array($result[1],$tmp[0]) && in_array($result[3],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22340)	//	千个
		{
			return in_array($result[1],$tmp[0]) && in_array($result[4],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22341)	//	千百
		{
			return in_array($result[1],$tmp[0]) && in_array($result[2],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22342)	//	百十
		{
			return in_array($result[2],$tmp[0]) && in_array($result[3],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22343)	//	百个
		{
			return in_array($result[2],$tmp[0]) && in_array($result[4],$tmp[1]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选二单式
	if($plays['parentid'] == 2191)
	{
		$tmp = explode('_',$data['rednum']);
		
		if($plays['playid'] == 22344)	//	万十
		{
			return in_array($result[0].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22345)	//	万千
		{
			return in_array($result[0].$result[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22346)	//	万个
		{
			return in_array($result[0].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22347)	//	万百
		{
			return in_array($result[0].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22348)	//	十个
		{
			return in_array($result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22349)	//	千十
		{
			return in_array($result[1].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22350)	//	千个
		{
			return in_array($result[1].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22351)	//	千百
		{
			return in_array($result[1].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22352)	//	百十
		{
			return in_array($result[2].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22353)	//	百个
		{
			return in_array($result[2].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选二和值
	if($plays['parentid'] == 2192)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 22354)	//	万十
		{
			return in_array(($result[0] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22355)	//	万千
		{
			return in_array(($result[0] + $result[1]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22356)	//	万个
		{
			return in_array(($result[0] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22357)	//	万百
		{
			return in_array(($result[0] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22358)	//	十个
		{
			return in_array(($result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22359)	//	千十
		{
			return in_array(($result[1] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22360)	//	千个
		{
			return in_array(($result[1] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22361)	//	千百
		{
			return in_array(($result[1] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22362)	//	百十
		{
			return in_array(($result[2] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22362)	//	百个
		{
			return in_array(($result[2] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任二组选复式
	if($plays['parentid'] == 2193)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 22364)	//	万十
		{
			return in_array($result[0],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22365)	//	万千
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22366)	//	万个
		{
			return in_array($result[0],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22367)	//	万百
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22368)	//	十个
		{
			return in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22369)	//	千十
		{
			return in_array($result[1],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22370)	//	千个
		{
			return in_array($result[1],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22371)	//	千百
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22372)	//	百十
		{
			return in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22373)	//	百个
		{
			return in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选二组选单式
	if($plays['parentid'] == 2194)
	{
		$tmp = explode('_',$data['rednum']);
		
		if($plays['playid'] == 22374)	//	万十
		{
			return in_array($result[0].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22375)	//	万千
		{
			return in_array($result[0].$result[1],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22376)	//	万个
		{
			return in_array($result[0].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22377)	//	万百
		{
			return in_array($result[0].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22378)	//	十个
		{
			return in_array($result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22379)	//	千十
		{
			return in_array($result[1].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22380)	//	千个
		{
			return in_array($result[1].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22381)	//	千百
		{
			return in_array($result[1].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22382)	//	百十
		{
			return in_array($result[2].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22383)	//	百个
		{
			return in_array($result[2].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选二组选和值
	if($plays['parentid'] == 2195)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 22384)	//	万十
		{
			return in_array(($result[0] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22385)	//	万千
		{
			return in_array(($result[0] + $result[1]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22386)	//	万个
		{
			return in_array(($result[0] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22387)	//	万百
		{
			return in_array(($result[0] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22388)	//	十个
		{
			return in_array(($result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22389)	//	千十
		{
			return in_array(($result[1] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22390)	//	千个
		{
			return in_array(($result[1] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22391)	//	千百
		{
			return in_array(($result[1] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22392)	//	百十
		{
			return in_array(($result[2] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22393)	//	百个
		{
			return in_array(($result[2] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任选三单式
	if($plays['parentid'] == 2196)
	{
		$tmp = explode('_',$data['rednum']);
		
		if($plays['playid'] == 22394)	//	万十个
		{
			return in_array($result[0].$result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22395)	//	万千十
		{
			return in_array($result[0].$result[1].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22396)	//	万千个
		{
			return in_array($result[0].$result[1].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22397)	//	万千百
		{
			return in_array($result[0].$result[1].$result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22398)	//	万百十
		{
			return in_array($result[0].$result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22399)	//	万百个
		{
			return in_array($result[0].$result[2].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22400)	//	千十个
		{
			return in_array($result[1].$result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22401)	//	千百十
		{
			return in_array($result[1].$result[2].$result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22402)	//	千百个
		{
			return in_array($result[1].$result[2].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22403)	//	百十个
		{
			return in_array($result[2].$result[3].$result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三直选复式
	if($plays['parentid'] == 2197)
	{
		$tmp = explode('|',$data['rednum']);
		$tmp[0] = explode(',',$tmp[0]);
		$tmp[1] = explode(',',$tmp[1]);
		$tmp[2] = explode(',',$tmp[2]);
		
		if($plays['playid'] == 22404)	//	万十个
		{
			return in_array($result[0],$tmp[0]) && in_array($result[3],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22405)	//	万千十
		{
			return in_array($result[0],$tmp[0]) && in_array($result[1],$tmp[1]) && in_array($result[3],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22406)	//	万千个
		{
			return in_array($result[0],$tmp[0]) && in_array($result[1],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22407)	//	万千百
		{
			return in_array($result[0],$tmp[0]) && in_array($result[1],$tmp[1]) && in_array($result[2],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22408)	//	万百十
		{
			return in_array($result[0],$tmp[0]) && in_array($result[2],$tmp[1]) && in_array($result[3],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22409)	//	万百个
		{
			return in_array($result[0],$tmp[0]) && in_array($result[2],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22410)	//	千十个
		{
			return in_array($result[1],$tmp[0]) && in_array($result[3],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22411)	//	千百十
		{
			return in_array($result[1],$tmp[0]) && in_array($result[2],$tmp[1]) && in_array($result[3],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22412)	//	千百个
		{
			return in_array($result[1],$tmp[0]) && in_array($result[2],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22413)	//	百十个
		{
			return in_array($result[2],$tmp[0]) && in_array($result[3],$tmp[1]) && in_array($result[4],$tmp[2]) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三直选和值
	if($plays['parentid'] == 2198)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 22414)	//	万十个
		{
			return in_array(($result[0] + $result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22415)	//	万千十
		{
			return in_array(($result[0] + $result[1] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22416)	//	万千个
		{
			return in_array(($result[0] + $result[1] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22417)	//	万千百
		{
			return in_array(($result[0] + $result[1] + $result[2]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22418)	//	万百十
		{
			return in_array(($result[0] + $result[2] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22419)	//	万百个
		{
			return in_array(($result[0] + $result[2] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22420)	//	千十个
		{
			return in_array(($result[1] + $result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22421)	//	千百十
		{
			return in_array(($result[1] + $result[2] + $result[3]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22422)	//	千百个
		{
			return in_array(($result[1] + $result[2] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22423)	//	百十个
		{
			return in_array(($result[2] + $result[3] + $result[4]),$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三组三	投注双注（如2|3代表23和32）
	if($plays['parentid'] == 2199)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 22424)	//	万十个
		{
			return in_array($result[0],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22425)	//	万千十
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22426)	//	万千个
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22427)	//	万千百
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22428)	//	万百十
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22429)	//	万百个
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22430)	//	千十个
		{
			return in_array($result[1],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22431)	//	千百十
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22432)	//	千百个
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22433)	//	百十个
		{
			return in_array($result[2],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三组六	投注单注
	if($plays['parentid'] == 2200)
	{
		$tmp = explode('|',$data['rednum']);
		
		if($plays['playid'] == 22434)	//	万十个
		{
			return in_array($result[0],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22435)	//	万千十
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22436)	//	万千个
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22437)	//	万千百
		{
			return in_array($result[0],$tmp) && in_array($result[1],$tmp) && in_array($result[2],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22438)	//	万百十
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22439)	//	万百个
		{
			return in_array($result[0],$tmp) && in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22440)	//	千十个
		{
			return in_array($result[1],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22441)	//	千百十
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[3],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22442)	//	千百个
		{
			return in_array($result[1],$tmp) && in_array($result[2],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		if($plays['playid'] == 22423)	//	百十个
		{
			return in_array($result[2],$tmp) && in_array($result[3],$tmp) && in_array($result[4],$tmp) ? $plays['maxprize'] * $data['times'] : 0;
		}
		
		return 0;
	}
	
	//	任三混合组选
	if($plays['parentid'] == 2201)
	{
		$tmp2 = [];
		if($plays['playid'] == 22444)	//	万十个
		{
			$tmp2 = [$result[0],$result[3],$result[4]];
		}
		else if($plays['playid'] == 22446)	//	万千十
		{
			$tmp2 = [$result[0],$result[1],$result[3]];
		}
		else if($plays['playid'] == 22448)	//	万千个
		{
			$tmp2 = [$result[0],$result[1],$result[4]];
		}
		else if($plays['playid'] == 22450)	//	万千百
		{
			$tmp2 = [$result[0],$result[1],$result[2]];
		}
		else if($plays['playid'] == 22452)	//	万百十
		{
			$tmp2 = [$result[0],$result[2],$result[3]];
		}
		else if($plays['playid'] == 22454)	//	万百个
		{
			$tmp2 = [$result[0],$result[2],$result[4]];
		}
		else if($plays['playid'] == 22456)	//	千十个
		{
			$tmp2 = [$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 22458)	//	千百十
		{
			$tmp2 = [$result[1],$result[2],$result[3]];
		}
		else if($plays['playid'] == 22460)	//	千百个
		{
			$tmp2 = [$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 22462)	//	百十个
		{
			$tmp2 = [$result[2],$result[3],$result[4]];
		}
		
		$tmp2 = array_unique($tmp2);	//	组合中不会出现重复		
		$tmp8 = 0;	//	所中奖金
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t1)
		{
			$tmp3 = 0;
			
			$tmp4 = explode(',',$t1);
			foreach($tmp4 as $t4)
			{
				in_array($t4,$tmp2) && $tmp3++;
			}
			
			if($tmp3 > 2)	//	组六
			{
				$tmp8 += NumGroup($tmp3,3) * $t2[1]['maxprize'];
			}
			else if($tmp3 > 1)	//	组三
			{
				$tmp8 += $t2[0]['maxprize'];
			}
		}

		return $tmp8 ? $tmp8 * $data['times'] : 0;
	}
	
	//	任三组选和值
	if($plays['parentid'] == 2202)
	{
		$tmp = '';	//	和值
		$tmp3 = 0;	//	是否有对子
		if($plays['playid'] == 22464)	//	万十个
		{
			$tmp = $result[0] + $result[3] + $result[4];
			$tmp3 = ($result[0] == $result[3]) || ($result[0] == $result[4]) || ($result[3] == $result[4]);
		}
		else if($plays['playid'] == 22466)	//	万千十
		{
			$tmp = $result[0] + $result[1] + $result[3];
			$tmp3 = ($result[0] == $result[3]) || ($result[0] == $result[1]) || ($result[3] == $result[1]);
		}
		else if($plays['playid'] == 22468)	//	万千个
		{
			$tmp = $result[0] + $result[1] + $result[4];
			$tmp3 = ($result[0] == $result[1]) || ($result[0] == $result[1]) || ($result[1] == $result[4]);
		}
		else if($plays['playid'] == 22470)	//	万千百
		{
			$tmp = $result[0] + $result[1] + $result[2];
			$tmp3 = ($result[0] == $result[1]) || ($result[0] == $result[2]) || ($result[1] == $result[2]);
		}
		else if($plays['playid'] == 22472)	//	万百十
		{
			$tmp = $result[0] + $result[2] + $result[3];
			$tmp3 = ($result[0] == $result[2]) || ($result[0] == $result[3]) || ($result[2] == $result[3]);
		}
		else if($plays['playid'] == 22474)	//	万百个
		{
			$tmp = $result[0] + $result[2] + $result[4];
			$tmp3 = ($result[0] == $result[2]) || ($result[0] == $result[4]) || ($result[2] == $result[4]);
		}
		else if($plays['playid'] == 22476)	//	千十个
		{
			$tmp = $result[1] + $result[3] + $result[4];
			$tmp3 = ($result[1] == $result[3]) || ($result[1] == $result[3]) || ($result[3] == $result[4]);
		}
		else if($plays['playid'] == 22478)	//	千百十
		{
			$tmp = $result[1] + $result[2] + $result[3];
			$tmp3 = ($result[1] == $result[2]) || ($result[1] == $result[3]) || ($result[2] == $result[3]);
		}
		else if($plays['playid'] == 22480)	//	千百个
		{
			$tmp = $result[1] + $result[2] + $result[4];
			$tmp3 = ($result[1] == $result[2]) || ($result[1] == $result[4]) || ($result[2] == $result[4]);
		}
		else if($plays['playid'] == 22482)	//	百十个
		{
			$tmp = $result[2] + $result[3] + $result[4];
			$tmp3 = ($result[2] == $result[3]) || ($result[2] == $result[4]) || ($result[3] == $result[4]);
		}
		
		$tmp2 = explode('|',$data['rednum']);		
		if(!in_array($tmp,$tmp2))
		{
			return 0;
		}
		
		//	组三和组六奖金
		$t2 = $db->getall('SELECT maxprize FROM '.Table('lottery_play').' WHERE playid = '.$plays['playid'].' AND cid = '.$plays['cid'].' ORDER BY maxprize');
		
		//	有重复值则中组三，否则中组六
		return ($tmp3 ? $t2[0]['maxprize'] : $t2[1]['maxprize']) * $data['times'];
	}
	
	//	任四直选单式
	if($plays['parentid'] == 2613)
	{
		$tmp2 = [];
		if($plays['playid'] == 23515)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23516)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23517)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23518)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23519)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp2 = implode(',',$tmp2);	//	开奖号
		$tmp0 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t)
		{
			$tmp2 == $t && $tmp0++;
		}
		
		return $tmp0 * $plays['maxprize'] * $data['times'];
	}
	
	//	任四直选复式
	if($plays['parentid'] == 2614)
	{
		$tmp2 = [];
		if($plays['playid'] == 23520)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23521)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23522)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23523)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23524)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp0 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		for($i = 0; $i < 4; $i++)
		{
			in_array($tmp2[$i],explode(',',$tmp[$i])) && $tmp0++;
		}
		
		return $tmp0 == 4 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	任四组选24
	if($plays['parentid'] == 2618)
	{
		$tmp2 = [];
		if($plays['playid'] == 23540)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23541)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23542)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23543)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23544)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp0 = 0;	//	中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp2 as $t)
		{
			in_array($t2,$tmp) && $tmp0++;
		}
		
		return $tmp0 == 4 ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	任四组选12
	if($plays['parentid'] == 2617)
	{
		$tmp2 = [];
		if($plays['playid'] == 23535)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23536)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23537)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23538)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23539)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp4 = array_count_values($tmp2);
		if(count($tmp4) != 3)	//	只能出现两个一样的，余下两个不一样，也就是三个数
		{
			return 0;
		}
		
		$tmp0 = $tmp3 = 0;	//	二重码中奖个数，1码个数
		$tmp = explode('|',$data['rednum']);
		$tmp[0] = explode(',',$tmp[0]);
		$tmp[1] = explode(',',$tmp[1]);
		foreach($tmp[0] as $t)
		{
			$tmp4[$t] == 2 && $tmp0++;
		}
		foreach($tmp[1] as $t)
		{
			$tmp4[$t] == 1 && $tmp3++;
		}
		
		return ($tmp0 > 0) && ($tmp3 > 2) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	任四组选6
	if($plays['parentid'] == 2616)
	{
		$tmp2 = [];
		if($plays['playid'] == 23530)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23531)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23532)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23533)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23534)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp4 = array_count_values($tmp2);
		if(count($tmp4) != 2)	//	只能出现两对，也就是2个数
		{
			return 0;
		}
		
		$tmp0 = 0;	//	二重码中奖个数
		$tmp = explode('|',$data['rednum']);
		foreach($tmp as $t)
		{
			$tmp4[$t] == 2 && $tmp0++;
		}
		
		return ($tmp0 > 1) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	//	任四组选4
	if($plays['parentid'] == 2615)
	{
		$tmp2 = [];
		if($plays['playid'] == 23525)	//	千百十个
		{
			$tmp2 = [$result[1],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23526)	//	万百十个
		{
			$tmp2 = [$result[0],$result[2],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23527)	//	万千十个
		{
			$tmp2 = [$result[0],$result[1],$result[3],$result[4]];
		}
		else if($plays['playid'] == 23528)	//	万千百个
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[4]];
		}
		else if($plays['playid'] == 23529)	//	万千百十
		{
			$tmp2 = [$result[0],$result[1],$result[2],$result[3]];
		}
		
		if(!$tmp2)
		{
			return 0;
		}
		
		$tmp4 = array_count_values($tmp2);
		if(count($tmp4) != 2)	//	只能出现1个三号的，余下1个，也就是2个数
		{
			return 0;
		}
		
		$tmp0 = $tmp3 = 0;	//	三重码中奖个数，1码个数
		$tmp = explode('|',$data['rednum']);
		$tmp[0] = explode(',',$tmp[0]);
		$tmp[1] = explode(',',$tmp[1]);
		foreach($tmp[0] as $t)
		{
			$tmp4[$t] == 3 && $tmp0++;
		}
		foreach($tmp[1] as $t)
		{
			$tmp4[$t] == 1 && $tmp3++;
		}
		
		return ($tmp0 > 0) && ($tmp3 > 0) ? $plays['maxprize'] * $data['times'] : 0;
	}
	
	return 0;
}